package kongkong;

import java.net.URL;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * 启动
 * @author 53045
 *
 */
public class StartApp extends Application{
	
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		try {
			URL location = getClass().getResource("StartAppUi.fxml");
	        FXMLLoader fxmlLoader = new FXMLLoader();
	        fxmlLoader.setLocation(location);
	        fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
			
	        Parent root = fxmlLoader.load();
	        
			Scene scene = new Scene(root);
			scene.getStylesheets().add(getClass().getResource("StartAppUi.css").toExternalForm());
			
			primaryStage.setScene(scene);
			primaryStage.setResizable(false);
			primaryStage.setTitle("图片压缩工具");
			primaryStage.initStyle(StageStyle.TRANSPARENT);
			primaryStage.show();
			StartAppController controller = fxmlLoader.getController(); 
			controller.load(primaryStage);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
